﻿using System.IO;

namespace Dsl.Ped.Editor.Helpers
{
    /// <summary>
    /// Helper methods for working with files
    /// </summary>
    public class FileHelper
    {
        /// <summary>
        /// Get the content of a given file
        /// </summary>
        /// <param name="fileName">Name of the file to read</param>
        /// <returns><see cref="string"/> content of the given file, if the file exists, otherwise return null</returns>
        public static string GetFileContent(string fileName)
        {
            if (!File.Exists(fileName)) return null;
            var xmlFileContent = File.ReadAllText(fileName);

            return xmlFileContent;
        }
    }
}
